# -*- encoding: utf-8 -*-

class Not (object):

    """ Classe définissant une instruction NOT Ra, Rb """

    def __init__ (self, ra,rb, mem):
        self.__ra = ra
        self.__rb = rb
        self.__mem = mem

    def do (self):
        self.__mem.setRegister(
            num = self.__ra,
            newVal =  ~ self.__mem.getRegister(self.__rb)
            )

    def __str__ (self):
        return "not r{0:d} r{1:d}".format(self.__ra,self.__rb) 

    def __unicode__ (self):
        return self.__str__ () 
